obj-y += backtrace.o
obj-y += bitops.o
obj-y += boot_of.o
+obj-y += cmdline.o
obj-y += dart.o
obj-y += dart_u3.o
obj-y += dart_u4.o
HDRS += $(wildcard *.h)
+ifneq ($(CMDLINE),)
# The first token in the arguments will be silently dropped.
-IMAGENAME = xen
-CMDLINE = ""
-boot_of.o: CFLAGS += -DCMDLINE="\"$(IMAGENAME) $(CMDLINE)\""
+FULL_CMDLINE := xen $(CMDLINE)
+endif
+cmdline.o: CFLAGS += -DCMDLINE="\"$(FULL_CMDLINE)\""
TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,0x400000,-T,xen.lds
TARGET_OPTS += start.o $(ALL_OBJS)
* Copyright (C) IBM Corp. 2005, 2006
*
* Authors: Jimi Xenidis <jimix@watson.ibm.com>
+ * Hollis Blanchard <hollisb@us.ibm.com>
*/
#include <xen/config.h>
static ulong of_vec;
static ulong of_msr;
static int of_out;
-static char bootargs[256];
-
-#define COMMAND_LINE_SIZE 512
-static char builtin_cmdline[COMMAND_LINE_SIZE]
- __attribute__((section("__builtin_cmdline"))) = CMDLINE;
+extern char builtin_cmdline[];
extern struct ns16550_defaults ns16550;
#undef OF_DEBUG
{
int rc;
- rc = of_getprop(bof_chosen, "bootargs", &bootargs, sizeof (bootargs));
- if (rc == OF_FAILURE || bootargs[0] == '\0') {
- strlcpy(bootargs, builtin_cmdline, sizeof(bootargs));
+ if (builtin_cmdline[0] == '\0') {
+ rc = of_getprop(bof_chosen, "bootargs", builtin_cmdline,
+ CONFIG_CMDLINE_SIZE);
+ if (rc > CONFIG_CMDLINE_SIZE)
+ of_panic("bootargs[] not big enough for /chosen/bootargs\n");
}
mbi->flags |= MBI_CMDLINE;
- mbi->cmdline = (u32)bootargs;
+ mbi->cmdline = (ulong)builtin_cmdline;
- of_printf("bootargs = %s\n", bootargs);
+ of_printf("bootargs = %s\n", builtin_cmdline);
}
static int save_props(void *m, ofdn_t n, int pkg)
--- /dev/null
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Hollis Blanchard <hollisb@us.ibm.com>
+ */
+
+#include <asm/config.h>
+
+char builtin_cmdline[CONFIG_CMDLINE_SIZE]
+ __attribute__((section("__builtin_cmdline"))) = CMDLINE;